<!-- prompt组件 -->
<!-- prompt -->
<template>
	<view class="prompt-box" :hidden="isHidden">
		<view class="button-box">
			<button class="sure" @tap="chooseSex">确定</button>
		</view>
		<view class="prompt-content contentFontColor">
			<view class="nan sex-item" @tap="tapNan">
				<view class="">男</view>
				<icon v-if="itSex == 1" type="success_no_circle"></icon>
			</view>
			<view class="nv sex-item" @tap="tapNv">
				<view class="">女</view>
				<icon v-if="itSex == 2" type="success_no_circle"></icon>
			</view>
		</view>
	</view>
</template>
<script>
	export default {
		name: "sexCompo",
		data() {
			return {
				isHidden: true,
				itSex: 0
			};
		},
		props:{
			sex: 0
		},
		created() {
			var sex = this.sex;
			console.log(this.sex);
			this.itSex = sex;
		},
		methods: {
			hide: function () {
			  this.isHidden=true;
			},
			show() {
			  this.isHidden=false;
			},
			tapNan(){
				this.itSex = 1;
			},
			tapNv(){
				this.itSex = 2;
			},
			chooseSex(){
				this.hide();
				this.$emit("chooseSex", this.itSex);
			}
		}
	}
</script>

<style>
	.prompt-box {
	  position: absolute;
	  left: 0;
	  top: 0;
	  width: 100%;
	  height: 100%;
	  z-index: 11;
	  background: rgba(0, 0, 0, 0.5);
	}
	.prompt-content {
	  position: absolute;
	  left: 50%;
	  top: 40%;
	  width: 80%;
	  max-width: 600rpx;
	  border: 2rpx solid #ccc;
	  border-radius: 10rpx;
	  box-sizing: bordre-box;
	  transform: translate(-50%, -50%); 
	  overflow: hidden;
	  background: #fff;
	}
	.sex-item {
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
		padding: 0rpx 40rpx;
	}
	.nan {
		border-bottom: 1px solid gray;
	}
	.sure{
		margin-top: 30upx;
		margin-right: 30upx;
		width: 90upx;
		height: 40upx;
		font-size: 35upx;
		line-height: 40upx;
		padding: 0px;
		background-color: #009898;
	}
</style>